<div class="thickwindow">
<div id="flash_placeholder">
<p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>
</div>
<!--div class="controls">
<a href="javascript:vid_player.sendEvent('PLAY')">Play/Pause</a>
<a href="javascript:vid_player.sendEvent('SEEK', currentPosition-10);">&lt;&lt;</a>
<a href="javascript:vid_player.sendEvent('SEEK', currentPosition+10);">&gt;&gt;</a>

<span id="player_time"></span>

</div-->
</div>

<script type="text/javascript" src="{{ MEDIA_URL }}common/js/swfobject.js"></script>
<script type="text/javascript">
/* <![CDATA[ */

    function createPlayer() {
        var flashvars = {
                file:"{{ object.get_original_url }}", 
                autostart:"false",
                controlbar:"over",
                skin:"{{ MEDIA_URL }}common/swf/modieus.swf",
                image:"{{ object.frame.image.url }}", 
                //showicons:"false",
                //showdigits:"false",
                //displayheight:'175',
                //enablejs: true,
                //searchbar:false,
                //hownavigation: false,
        }
        var params = {
                allowfullscreen:"true", 
                allowscriptaccess:"always"
        }
        var attributes = {
                    id:"vid_player",
                    name:"vid_player"
            }
        swfobject.embedSWF("{{ MEDIA_URL }}common/swf/player-viral.swf", "flash_placeholder", "{{ object.get_width }}", "{{ object.get_height }}", "9.0.115", false, flashvars, params, attributes);
    }

    createPlayer();    

    var vid_player = null; 
    /* swf does a callback */
    function playerReady(thePlayer) { 
        vid_player  = document.getElementById("vid_player"); 
        //addListeners();
    }

    /* 
http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_6-2-0-0.html
    */
    /*
    function addListeners() {
        if (vid_player) { 
            //player.addControllerListener("ITEM", "itemListener");
            //player.addControllerListener("MUTE", "muteListener");

            //player.addModelListener("LOADED", "loadedListener");
            //player.addModelListener("STATE", "stateListener");
            vid_player.addModelListener("TIME", "positionListener");

            //player.addViewListener("VOLUME", "volumeListener");
        } else {
            setTimeout("addListeners()",100);
        }
    }

    function positionListener(obj) { 
        currentPosition = obj.position; 
        var tmp = document.getElementById("player_time");
        if (tmp) { tmp.innerHTML = "position: " + currentPosition; }
    }
/* ]]> */
</script>


